package com.wanmait.recruit.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.recruit.mapper.EducationalBackgroundTypeMapper;
import com.wanmait.recruit.pojo.EducationalBackgroundType;
import com.wanmait.recruit.service.EducationalBackgroundTypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service("educationalBackgroundTypeService")
@Transactional(rollbackFor = Exception.class)
public class EducationalBackgroundTypeServiceImpl implements EducationalBackgroundTypeService {
    @Resource
    private EducationalBackgroundTypeMapper educationalBackgroundTypeMapper;

    public int deleteByPrimaryKey(Integer id){
        return educationalBackgroundTypeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void insert(EducationalBackgroundType object) {

    }

    @Override
    public void delete(EducationalBackgroundType object) {

    }

    @Override
    public void update(EducationalBackgroundType object) {

    }

    @Override
    public PageInfo<EducationalBackgroundType> search(int pageNum, int pageSize) {
        return null;
    }
    public int insertSelective (EducationalBackgroundType record){
        return educationalBackgroundTypeMapper.insertSelective(record);
    }

    public EducationalBackgroundType selectByPrimaryKey (Integer id){
        return educationalBackgroundTypeMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective (EducationalBackgroundType record){
        return educationalBackgroundTypeMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey (EducationalBackgroundType record){
        return educationalBackgroundTypeMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<EducationalBackgroundType> findAll() {
        return educationalBackgroundTypeMapper.findAll();
    }

    @Override
    public String selectByEducationTypeId (Integer id){
        EducationalBackgroundType educationalBackgroundType = educationalBackgroundTypeMapper.selectByPrimaryKey(id);
        return educationalBackgroundType.getEducationalBackgroundTypeName();
    }

    @Override
    public ArrayList<EducationalBackgroundType> selectFindAll () {
        return educationalBackgroundTypeMapper.findAll();
    }
}
